package com.ruoyi.function.service.impl;


import com.ruoyi.function.domain.CarBrand;
import com.ruoyi.function.domain.CarModel;
import com.ruoyi.function.domain.CarSeries;
import com.ruoyi.function.mapper.CarBrandMapper;
import com.ruoyi.function.mapper.CarModelMapper;
import com.ruoyi.function.mapper.CarSeriesMapper;
import com.ruoyi.function.service.ICarBrandService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CarBrandServiceImpl implements ICarBrandService {

    @Autowired
    private CarBrandMapper carBrandMapper;

    @Autowired
    private CarSeriesMapper carSeriesMapper;

    @Autowired
    private CarModelMapper carModelMapper;

    @Override
    public List<CarBrand> getBrandList() {
        return carBrandMapper.selectBrandList(1);
    }

    @Override
    public List<CarSeries> getSeriesList(Integer brandId) {
        return carBrandMapper.selectSeriesByBrandId(brandId);
    }

    @Override
    public List<CarModel> getModelList(Integer seriesId) {
        return carBrandMapper.selectModelBySeriesId(seriesId);
    }

    @Override
    public CarBrand getBrandById(Long brandId) {
        return carBrandMapper.selectById(brandId);
    }

    @Override
    public CarSeries getSeriesById(Long seriesId) {
        return carSeriesMapper.selectById(seriesId);
    }

    @Override
    public CarModel getModelById(Long modelId) {
        return carModelMapper.selectById(modelId);
    }
} 